package threads;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;



public class testSy {

	public static void main(String[] args) {
		
		ExecutorService executor=Executors.newFixedThreadPool(2);
		executor.execute(new Task(1));
		executor.execute(new Task(2));

	}

}

class Task implements Runnable{
    int i;
    public Task(int i) {
    	this.i=i;
    }
	@Override
	public void run() {
		new F().methodA(i);
		
	}
	
}



class F {
	


    public static synchronized void methodA(int k)

   {

     
    	   for(int i=0;i<5;i++) {
    		   System.out.println("我是线程"+k+i);
    	   

     }
	
	
	
   }

}
